package jtk.project4.fleet.field;

import java.awt.FlowLayout;
//import jtk.project4.fleet.domain.CostStatistic;
import nl.coderight.jazz.form.FormLayout;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.field.TableField;
import nl.coderight.jazz.form.field.table.TableFieldColumn;


public class PreventiveMaintenanceField extends GroupControl{//<CostStatistic>{
		private TableField field1;
		private TableFieldColumn pmserv;
		private TableFieldColumn partcost;
		private TableFieldColumn laborcost;
		private TableFieldColumn totalCost;
		private TableFieldColumn percentOfTotal;
		//private TableFieldColumn description;
		
		
		public PreventiveMaintenanceField(String bindID){
			setBindID(bindID);
			createFields();
			createLayout();
			
		}
		
		
		private void createLayout() {
			// TODO Auto-generated method stub
			setLayout(new FormLayout ())
			//.addField(photofield1)
			//.addRow()
			//.addRow()
			.addField(field1);
		}


		private void createFields(){
			field1 = new TableField("","");
			
			pmserv = new TableFieldColumn ("PM Service", "");
			
			partcost = new TableFieldColumn ("Part Cost", "");
			
			laborcost = new TableFieldColumn ("Labor Cost", "");
			
			totalCost = new TableFieldColumn ("Total Cost", "");
			
			percentOfTotal = new TableFieldColumn ("% of Total", "");
			
			field1.addColumn(pmserv);

			field1.addColumn(partcost);
			
			field1.addColumn(laborcost);
			
			field1.addColumn(totalCost);

			field1.addColumn(percentOfTotal);
		
		}
		
		/*private GroupControl createTableFieldColumn() {
			GroupControl TableFieldColumn = new GroupControl();
			.setLayout(new FlowLayout(FlowLayout.LEFT));
			.focusField(identification);
			return TableFieldColumn;
		}*/
		private GroupControl createTableFieldColumn() {
			GroupControl tableFieldColumn = new GroupControl();
			tableFieldColumn.setLayout(new FlowLayout(FlowLayout.CENTER));
			tableFieldColumn.focusField(field1);
			return tableFieldColumn;
		}
		
		
	}

